package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.base.enums.FlagEnum;
import com.ym.medical.domain.entity.FeedBackEntity;
import com.ym.medical.enums.AskTypeEnum;
import com.ym.medical.enums.HandleStateEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 帮助反馈对象 feed_back
 *
 * @author ym
 * @date 2020-09-01
 */
@ApiModel("帮助反馈-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FeedBackUpdateParam extends BeanCovert<FeedBackEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("问题类型（01其他）")
    @NotEmpty(message = "问题类型不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "问题类型长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(AskTypeEnum.class)
    private String askType;

    @ApiModelProperty("手机号")
    @Size(max = 20, message = "手机号长度超过{max}", groups = {Add.class, Update.class})
    private String phoneNo;

    @ApiModelProperty("反馈内容")
    @NotEmpty(message = "反馈内容不能为空", groups = {Add.class, Update.class})
    @Size(max = 1024, message = "反馈内容长度超过{max}", groups = {Add.class, Update.class})
    private String backContent;

    @ApiModelProperty("状态,01未处理02已处理")
    @NotEmpty(message = "状态,01未处理02已处理不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "状态,01未处理02已处理长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(HandleStateEnum.class)
    private String state;

    @ApiModelProperty("是否删除")
    @Size(max = 2, message = "是否删除长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(FlagEnum.class)
    private String deleted;

}
